<template>
    <div class="padding16">
        <div class="font_big_title">我的反馈</div>
        <DefaultC class="defalut" desc="没有数据~" :type="'noData'" v-if="list.length == 0"/>
        <div v-else>
            <div class="margin-top20 flex-row callbackItem" style="width:100%" v-for="(item,index) in list" :key="index" @click="toDetails(item)">
                <div class="flex-column" style="width:92%;">
                    <div class="font_big_title ellipsis1" style="font-size: 14px; width:100%">{{item.describes}}</div>
                    <div class="subtitle" style="margin-top:2px;">{{item.nowDate?new Date(item.nowDate).toLocaleString():''}}</div>
                </div>
                <img src="@/assets/img/more.png" alt="">
            </div>
        </div>
    </div>
</template>

<script>
import { DefaultC } from '@/components'
export default {
    data() {
        return {
            list: []
        }
    },
    components: {
        DefaultC
    },
    mounted(){
        this.$store.dispatch('queryCallBack',{userId: JSON.parse(localStorage.getItem('userMsg')).user_id}).then(res=>{
            this.list = res
        })
    },
    methods: {
        toDetails(item) {
            this.$store.dispatch('queryCallBackImg',{userId: JSON.parse(localStorage.getItem('userMsg')).user_id,eventId: item.eventId}).then(res=>{
                // console.log(res)
                let obj = item
                obj.imgList = res
                this.$router.push({name: 'SubmitCbC',query: {data: JSON.stringify(obj),imgList:JSON.stringify(res)}})
            })
        }
    }
}
</script>

<style lang="less" scoped>
@import '@/assets/style/style.less';
@import '@/assets/style/font.less';
@import '@/assets/style/color.less';
.callbackItem{
    justify-content: space-between;
    border-bottom: 1px solid @color_border_f5;
    >div:first-child{
        align-items: flex-start;
    }
    img{
        width: 14px;
        height: 14px;
    }
}
</style>